import axiosInstance from "../../plugins/axios";
import { ApiResponse } from "../../type/result";
export const uploadPicture = async (formData: FormData): Promise<string> => {  
    const res = await axiosInstance.post<ApiResponse<string>>('/minio/upload', formData, {
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    });
    if (res.data.code === 1) {
      return res.data.data; // 返回 URL
    } else {
      throw new Error(res.data.message || '上传图片失败');
    }
}   